package com.createImg.createImg;

import java.io.File;
import java.util.Hashtable;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageConfig;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
/**
 * Hello world!
 *
 */
public class App

{		

	
	public static void main(String[] args) throws Exception {
        String text = "gygyugygyuguyguy";   
        int width = 300;   
        int height = 300;   
        String format = "png";   
        Hashtable hints= new Hashtable();   
        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
         BitMatrix bitMatrix = new MultiFormatWriter().encode(text, BarcodeFormat.QR_CODE, width, height,hints);   
         File outputFile = new File("new.png");   

         MatrixToImageConfig matrixToImageConfig = new MatrixToImageConfig(0xFFFF0000 ,0xFF000000);
         
         MatrixToImageWriter.writeToFile(bitMatrix, format, outputFile,matrixToImageConfig); 
         
	}
}
